import request from '@/utils/request'

/**
 * 用户登录
 * @param {Object} data
 * @returns
 */
export function login(data) {
  return request({
    url: '/passport/login',
    method: 'post',
    data
  })
}

/**
 * 获取用户信息
 * @param {*} token
 * @returns
 */
export function getInfo(token) {
  return request({
    url: '/passport/account',
    method: 'get',
    params: {
      token
    }
  })
}

/**
 * 获取授权菜单
 * @returns
 */
export function getAuthMenu() {
  return request({
    url: '/passport/router',
    method: 'get'
  })
}

/**
 * 退出登录
 * @returns
 */
export function logout() {
  return request({
    url: '/passport/logout',
    method: 'post'
  })
}
